import { BASE_URL, TIME_OUT } from './config'
import XBRequest from './request'

export const xbRequest = new XBRequest({
  baseURL: BASE_URL, //'http://codercba.com:1888/airbnb/api',
  timeout: TIME_OUT, // 8000,
  interceptors: {
    requestSuccessFn: (config) => {
      // console.log('请求成功的拦截')
      return config
    },
    requestFailureFn: (err) => {
      // console.log('请求失败的拦截')
      return err
    },
    responseSuccessFn: (res) => {
      // console.log('响应成功的拦截')
      return res
    },
    responseFailureFn: (err) => {
      // console.log('响应失败的拦截')
      return err
    },
  },
})
